package com.bflow.api;

import com.bflow.api.bo.*;
import com.bflow.commons.bean.PageResult;
import com.bflow.commons.exception.BizException;

/**
 * 功能：IDefaultTemplateService 系统默认审批模板-业务接口
 * 作者：liaofeng
 * 日期：2019-01-03
 */
public interface IDefaultAuditTemplateService {

    /**
     * 查询历史记录列表
     *
     * @param queryParam
     * @param busiKeyType
     * @return
     * @throws BizException
     */
    PageResult<BflowRunInstanceBo> findHistoryList(BflowRunInstanceQueryParam queryParam, String busiKeyType) throws BizException;

    /**
     * 查询审批列表
     *
     * @param queryParam
     * @param userKey
     * @param busiKeyType
     * @return
     * @throws BizException
     */
    PageResult<BflowRunTaskBo> findAuditList(BflowRunTaskQueryParam queryParam, String userKey, String busiKeyType) throws BizException;

    /**
     * 提交申请
     *
     * @param instanceBo
     * @param auditUserIds
     * @param defActKey
     * @param defineProcessBo
     * @throws BizException
     */
    void addApply(BflowRunInstanceBo instanceBo, String auditUserIds, String defActKey, BflowDefineProcessBo defineProcessBo) throws BizException;

    /**
     * 审批
     *
     * @param bo
     * @param defActKey
     * @throws BizException
     */
    void audit(BflowRunTaskAuditBo bo, String defActKey) throws BizException;

    /**
     * 详情
     *
     * @param instanceId
     * @param userId
     * @return
     * @throws BizException
     */
    BflowRunInstanceBo detail(String instanceId, String userId) throws BizException;

    /**
     * 获取task任务数据
     *
     * @param taskId
     * @param userId
     * @param defActKey
     * @return
     * @throws BizException
     */
    BflowRunTaskBo getRunTaskDetail(String taskId, String userId, String defActKey) throws BizException;

    /**
     * 查询我的请假历史记录列表
     *
     * @param queryParam
     * @param busiKeyType
     * @return
     * @throws BizException
     */
    PageResult<BflowRunInstanceBo> findMyHistoryList(BflowRunInstanceQueryParam queryParam, String busiKeyType, String userId) throws BizException;

    /**
     * 查询抄送列表
     * @param queryParam
     * @param procKey 流程KEY
     * @param copyToIntervalType 抄送类型
     * @param copyToUserId 抄送人ID
     * @param finalConclusion 流程最终结论
     * @return
     * @throws BizException
     */
    PageResult<BflowDefineProcessBo> findCopyToList(BflowDefineProcessQueryParam queryParam, String procKey, String copyToIntervalType, String copyToUserId, String finalConclusion) throws BizException;
}
